# Create horizontal sliders

Use the Horizontal Slider option on the Animation menu to create a graphic object that can control the value of a specified tag. With horizontal slider animation, you define a path for the object, then use the mouse to move the object horizontally along its path. The pixel position of the object is translated into a value that is written to the tag.

A tag that has values input by slider animation can be used in an expression to attach animation to another object or group of objects. If the tag value is changed externally, the position of the slider will change as well.

Both vertical and horizontal slider animation can be attached to the same object.

You can attach horizontal slider animation to drawing objects only. The exceptions are the image and panel objects, which only support visibility animation.

## To create a horizontal slider

1. Draw an object that is to be the slider. It is also useful to draw an object, for example a line that represents the path the slider will move along.
2. Select the object, then choose Horizontal Slider from the Animation menu.
3. Type the name of the tag that will be associated with the slider.
4. Define the path for the slider by typing minimum and maximum pixel positions for the beginning and end of the path or by using the Object Smart Path feature.
5. Select the method to use to calculate the minimum and maximum values that are written to the tag.
6. Specify a range of values for the expression.

   Tip: | The value of the tag will be proportional to the horizontal position of the slider on the path defined by the minimum and maximum horizontal offsets. If the object is halfway along the path, the value of the tag will be halfway between the minimum and maximum tag values.

## Options

- Tag

  Type the name of the tag to which values will be written.

- Expression range
  - Use tag's min and max property values

    If you have specified an HMI tag in the Tag box, click this button to use the tag's minimum and maximum values to define the range of values for the expression.

  - Use constant

    To use constant numeric values to define a range of values, click this button and specify values for minimum and maximum.

  - Read from tags

    To define the range of values using one tag's value for the minimum and another tag's value for the maximum, click this button and then specify a tag for minimum and another for maximum. Using this option, when the display opens and animation for an object is started, the tags' values are read once to set the minimum and maximum values. The tags are not read again after the display is first opened, nor are the minimum and maximum values for the animation changed, even if the tag values change.

- Horizontal Offset (Pixels)

  Offset refers to the position of an object in relation to some starting point. When you select an object, its position is considered the starting point, which gives it an offset of 0.

  - At Minimum

    Type the offset, in pixels, of the beginning of the slider's path, or drag the slider to this position. Select the check box.

  - At Maximum

    Type the offset, in pixels, of the end of the slider's path, or drag the object to this position. Select the check box.

## See also

Attach animation to graphic objects

Use the Expression editor

Tag names with animation

Drawing objects

Object Smart Path